package model;

import java.io.File;
import java.util.Observable;


/**
 * Saves the file message into the conversation
 * 
 * <p>
 * <ul>
 * <li>Project: 		ChatSystemG3</li>
 * <li>Called by: 		Conversation</li>
 * </ul>
 * </p>
 * 
 * @author COMBES Nicolas - LECHANTRE Arnaud
 * @see ModelMessage
 */
public class ModelFileMessage extends ModelMessage {

	/**
	 * Sent message
	 */
	private File file;					
	/**
	 * Answer of the receiver
	 */
	private boolean accept;				
	/**
	 * Path to save the file
	 */
	private File downloadLink;			
	

	/**
	 * construct
	 * @param sender message sender
	 * @param message sent message
	 */
	public ModelFileMessage(User sender, File file) {
		super(sender);
		this.file = file;
		this.accept=false;
		this.downloadLink=null;
	}
	
	/**
	 * @return accept field
	 */
	public boolean isAccept() {
		return accept;
	}

	/**
	 * Sets accept field
	 */
	public void setAccept(boolean accept) {
		this.accept = accept;
	}

	/**
	 * @return downloadLink field
	 */
	public File getDownloadLink() {
		return downloadLink;
	}

	/**
	 * Sets downloadLink field
	 */
	public void setDownloadLink(File downloadLink) {
		this.downloadLink = downloadLink;
	}

	/**
	 * @return file field
	 */
	public File getFile() {
		return this.file;
	}

	/**
	 * Sets file field
	 */
	public void setMessage(File file) {
		this.file = file;
	}
	
	/**
	 * Sets accept and downloadLink field
	 */
	public void setAccepted(boolean accept, File downloadLink) {
		this.accept=accept;
		this.downloadLink=downloadLink;
	}
	
}
